/**
 * 
 */
package com.autosalon.ui.banka.action;

import com.autosalon.ui.banka.Banka;
import com.autosalon.ui.banka.state.BankaStateHolder;
import com.vaadin.ui.Button.ClickEvent;

/**
 * @author Ragisel
 *
 */
public class BackButtonAction extends AbstractBankAction{

	public BackButtonAction(Banka banka) {
		super(banka);
	}

	@Override
	public void buttonClick(ClickEvent event) {
		int id;
		try{
			id = banka.getSwitcher().getMainWindow().getZakaznik().getRole().getId().intValue();
		}catch (NullPointerException e) {
			id = 2;
		}
		BankaStateHolder.setState(BankaStateHolder.VIEW_BANKA_STATE,id, banka);
		
	}

	


}
